<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/d3.v4.min.js"></script>
	</head>
	<body>
		<p>Apple</p> 
		<p>Pear</p> 
		<p>Banana</p> 
	</body>
	<script>
	var body=d3.select("body")
	var p=body.selectAll("p")
	var str="China"
	// datum进行绑定一个数据
	// p.datum(str);	
	// p.text(function(d,i){
	// 	return "第"+i+"个元素的值为"+d;
	// })
	// data可以绑定一组数据
	var arr=["java","python","mysql"]	
	p.data(arr).text(function(d,i){
		return d
	})
	
	</script>
</html>
